USE [ERP]
GO

/****** Object:  Table [dbo].[EmployeeOfficialInfo]    Script Date: 11/16/2009 14:32:59 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EmployeeOfficialInfo](
	[EmployeeID] [nvarchar](50) NOT NULL,
	[PrimaryNationalityID] [nvarchar](50) NULL,
	[SecondaryNationalityID] [nvarchar](50) NULL,
	[DocumentTypeID] [nvarchar](50) NULL,
	[DocumentExpirationDate] [datetime] NULL,
	[DrivingLicenceTypeID] [nvarchar](50) NULL,
	[DrivingLicenceExpirationDate] [datetime] NULL,
	[TaxFileNumber] [nvarchar](50) NULL,
	[SocialSecurityNumber] [nvarchar](50) NULL,
	[DocumentNumber] [nvarchar](50) NULL,
	[DrivingLicenseNumber] [nvarchar](50) NULL,
 CONSTRAINT [PK_EmployeeOfficialInfo] PRIMARY KEY CLUSTERED 
(
	[EmployeeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[EmployeeOfficialInfo]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeOfficialInfo_DrivingLicenceTypes] FOREIGN KEY([DrivingLicenceTypeID])
REFERENCES [dbo].[DrivingLicenceTypes] ([ID])
GO

ALTER TABLE [dbo].[EmployeeOfficialInfo] CHECK CONSTRAINT [FK_EmployeeOfficialInfo_DrivingLicenceTypes]
GO

ALTER TABLE [dbo].[EmployeeOfficialInfo]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeOfficialInfo_Employees] FOREIGN KEY([EmployeeID])
REFERENCES [dbo].[Employees] ([ID])
GO

ALTER TABLE [dbo].[EmployeeOfficialInfo] CHECK CONSTRAINT [FK_EmployeeOfficialInfo_Employees]
GO

ALTER TABLE [dbo].[EmployeeOfficialInfo]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeOfficialInfo_Nationalities] FOREIGN KEY([PrimaryNationalityID])
REFERENCES [dbo].[Nationalities] ([ID])
GO

ALTER TABLE [dbo].[EmployeeOfficialInfo] CHECK CONSTRAINT [FK_EmployeeOfficialInfo_Nationalities]
GO

ALTER TABLE [dbo].[EmployeeOfficialInfo]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeOfficialInfo_Nationalities1] FOREIGN KEY([SecondaryNationalityID])
REFERENCES [dbo].[Nationalities] ([ID])
GO

ALTER TABLE [dbo].[EmployeeOfficialInfo] CHECK CONSTRAINT [FK_EmployeeOfficialInfo_Nationalities1]
GO

ALTER TABLE [dbo].[EmployeeOfficialInfo]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeOfficialInfo_OfficialDocumentTypes] FOREIGN KEY([DocumentTypeID])
REFERENCES [dbo].[OfficialDocumentTypes] ([ID])
GO

ALTER TABLE [dbo].[EmployeeOfficialInfo] CHECK CONSTRAINT [FK_EmployeeOfficialInfo_OfficialDocumentTypes]
GO

